home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-19
/
pkey12_1.zip
/
COL.LSP
< prev
next >
Wrap
Text File
|
1992-09-13
|
2KB
|
54 lines
;Add Columns and Grid Patterns
;
;
(defun dtr (a1)
(* pi (/ a1 180.0)))
(setq oer *error* *error* err)
(pre)
(If(= gx nil)(setq *gx 120))
(setq gx(getdist(strcat "X - grid spacing <"(rtos *gx)">: ")))
(if(= gx nil)(setq gx *gx)(setq *gx gx))
(if(= gy nil)(setq *gy 120))
(setq gy(getdist(strcat "Y - grid spacing <"(rtos *gy)">: ")))
(if(= gy nil)(setq gy *gy)(setq *gy gy))
(setq xa(atof(getstring "\nX - column size. :")))
(setq ya(atof(getstring(strcat "\nY - column size. <"(rtos xa)"):"))))
(if (= ya 0.0)(setq ya xa))
(if (= *cb nil)(setq *cb "S")
(setq cb *cb))
(setq colblk(getstring(strcat"\n(C)ircle. (S)quare. :< ")(prompt *cb)(prompt "\ >")
(princ)))
(if(= colblk "")(setq colblk *cb)(setq *cb colblk))
(If(or(= colblk "s")(= colblk "s"))(setq colblk "colsqr"))
(if(or(= colblk "c")(= colblk "c"))(setq colblk "colcir"))
(setq p1(getpoint "Pick lower left column grid limit. : "))
(Setq p0(getpoint "Pick upper right column grid limit. : "))
(Setq c(distance p1 p0))
(setq a1(angle p1 p0))
(setq b(* c(sin a1)))
(setq a(* c(cos a1)))
(setq aa(-(fix(/ a gx))1))
(if(= aa 0)(setq aa(+ aa 1)))
(setq d(/(- a(* aa gx))2))
(setq p2(list(+(car p1)d)(cadr p1)))
(setq p3(list(car p2)(+(cadr p2)b)))
(setq bb(-(fix(/ b gy))1))
(if(= bb 0)(setq bb(+ bb 1)))
(setq db(/(- b(* bb gy))2))
(setq p4(list(car p1)(+(cadr p1)db)))
(setq p5(list(+(car p4)a)(cadr p4)))
(setq ip(list(+(car p4)d)(cadr p4)))
(command"layer""S""cg""")
(command "line" p2 p3 "")
(command "array" "l" "" "r" "1"(+ aa 1)gx)
(command "line" p4 p5 "")
(command "array" "l" "" "r"(+ bb 1)"1" gy)
(setq cb1(strcat "\\kesym1\\" colblk))
(command"layer" "s" "ew" "")
(command"insert" cb1 ip xa ya "0")
(command"array" "l" "" "r""1"(+ aa 1)gx)
(setq a1 (angle p2 p3))
(setq wd (/(distance p1 p2)2))
(setq wp (polar p5 (+ a1 (dtr 0)) wd))
(command "array" "w" p1 wp "r" p4 "" "r"(+ bb 1)"1" gy)
(post)(setq p0 nil a nil aa nil b nil p1 nil p2 nil p3 nil bb nil db nil p4 nil p5 nil ip nil cb1 nil a1 nil wd nil wp nil)(princ)